﻿using System;
using System.ComponentModel.DataAnnotations;
using WeBlog.Interfaces;

namespace WeBlog.Models
{
    public class Page : IModel
    {        
        [Key]
        public int PageId { get; set; }

        public int? ParentId { get; set; }

        public int AuthorId { get; set; }
        [ForeignKey("AuthorId")]
        public virtual User Author { get; set; } 

        [Required]
        [StringLength(255)]
        public string Title { get; set; }

        [StringLength(4000)]
        public string Description { get; set; }

        [Required]
        [Column(TypeName = "ntext")]
        public string Content { get; set; }

        [StringLength(255)]
        public string Slug { get; set; }

        public DateTime? PublishDate { get; set; }

        [Required]
        public bool Published { get; set; }

        [Required]
        public DateTime LastModified { get; set; }               
    }
}
